﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Collections;
using System.Text;
using System.IO;

using FL.DBModule;
using FL.DBModule.Sys;
using FL.SiteEntity;
using FL.Common;

namespace FL.Bussiness.Site
{
    /// <summary>
    /// 导航
    /// </summary>
    public class BNav : BaseBussnies
    {

        public IList<t_site_navigation> GetMainNavList() {
            return GetNavList("main_nav");
        }

        public IList<t_site_navigation> GetNavList(string code)
        {
            t_site_navigation nav = this.GetEntityByCondition<t_site_navigation>("code='"+code+"'");
            IList<FL.SiteEntity.t_site_navigation> list = this.GetEntitys<FL.SiteEntity.t_site_navigation>(string.Format("is_push_nav='1' and parent_id='{0}'", nav.id));
            return list.OrderBy(p => p.sort).OrderBy(p => p.sort).ThenByDescending(p => p.sort).ToList();
        }

        public static BNav CreateInstance()
        {
            return new BNav();
        }
    }


}
